<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
</head>
<body>
<input type="hidden" name="orderNo" value="${orderNo}"/>
<input type="hidden" name="payPrice" value="${payPrice}"/>
<input type="hidden" name="openId" value="${openId}"/>
<input type="hidden" name="subOpenId" value="${subOpenId}"/>
</body>
<script src="${allServerPath}static/js/jquery-2.1.4.min.js"></script>
<script>
    $(document).ready(function () {
        $.ajax({
            type: 'post',
            url: '${allServerPath}wx/pay/wxH5Pay.htmls',
            dataType: 'JSON',
            data: {
                payPrice: '${payPrice}',
                orderNo: '${orderNo}',
                openId: '${openId}',
                subOpenId: '${subOpenId}'
            },
            success: function (obj) {
                if (obj.success) {
                    var prepay_id = obj.data.prepay_id;
                    var callbackUrl = obj.data.callbackUrl;
                    var cancelUrl = obj.data.cancelUrl;
                    window.location.href = "https://shq-api.51fubei.com/paypage?prepay_id=" + prepay_id + "&callback_url=" + callbackUrl + "&cancel_url=" + cancelUrl;
                }
            }
        });
    })
</script>
</html>
